package org.crown.project.api.module.wechatuser.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.crown.project.api.module.wechatuser.domain.TbWechatUser;
import org.crown.project.api.module.wechatuser.mapper.TbWechatUserMapper;
import org.crown.project.api.module.wechatuser.service.TbWechatUserService;
import org.crown.framework.service.impl.BaseServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 * 微信用户信息 服务实现类
 * </p>
 *
 * @author WuFengSheng
 * @since 2020-03-07
 */
@Service
public class TbWechatUserServiceImpl extends BaseServiceImpl<TbWechatUserMapper, TbWechatUser> implements TbWechatUserService{

    /**
      * 分页查询
      *
      * @param pageNum
      * @param pageSize
      * @param tbWechatUser
      * @return
      */
    @Override
    public PageInfo<TbWechatUser> page(int pageNum, int pageSize, TbWechatUser tbWechatUser){
        PageHelper.startPage(pageNum, pageSize);
        QueryWrapper<TbWechatUser> queryWrapper = new QueryWrapper<>();
        queryWrapper.setEntity(tbWechatUser);
        return new PageInfo<TbWechatUser>(baseMapper.selectList(queryWrapper));
    }

}
